package com.ych.controller;


import com.ych.beans.Message;
import com.ych.beans.Orga;
import com.ych.service.OrgaService;
import com.ych.util.logUtil.AddLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/sys")
public class OrgaController {
    @Autowired
    OrgaService service;

    @AddLog
    @GetMapping("/org")
    public Message selectOrg(@RequestParam Integer pageNo, @RequestParam(required = false) String key){
        return service.selectOrg(pageNo,key);
    }

    @AddLog
    @PostMapping("/org")
    public Message addOrg(@RequestBody Orga o){
        return service.addOrg(o);
    }

}
